{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "name": "Assignment 5",
      "provenance": [],
      "collapsed_sections": [],
      "toc_visible": true
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "PNYBb0NUWtPY"
      },
      "source": [
        "# ***`Assignment-5: Handwritten Digit Classification`***"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "qd2uDd8TW0Zv"
      },
      "source": [
        "# **`Task-1: Imporing, flattening the given data`**"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "orWq6DYO4_wX"
      },
      "source": [
        "#Importing necessary libraries\n",
        "from keras.datasets import mnist\n",
        "import numpy as np\n",
        "import pandas as pd\n",
        "import matplotlib.pyplot as plt\n",
        "from sklearn.linear_model import LinearRegression \n",
        "import numpy as np\n",
        "from sklearn.tree import DecisionTreeClassifier\n",
        "import random\n",
        "from sklearn.metrics import accuracy_score\n",
        "import pandas as pd"
      ],
      "execution_count": 391,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "hs2Sy5_I5R15"
      },
      "source": [
        "#Loading the given Data\n",
        "(X_train, y_train), (X_test, y_test) = mnist.load_data()"
      ],
      "execution_count": 392,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "TcTh6YV0HyIy",
        "outputId": "90f1b404-27a9-42e8-c59d-6ee902948620",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 369
        }
      },
      "source": [
        "#Representation of few training examples\n",
        "plt.figure(figsize=(7,5))\n",
        "for i in range(9):\n",
        "  plt.subplot(330+1+i)\n",
        "  plt.imshow(X_train[i])\n",
        "plt.tight_layout()"
      ],
      "execution_count": 393,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAbUAAAFgCAYAAAA8WedBAAAABHNCSVQICAgIfAhkiAAAAAlwSF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ieJnEMX3HEZR/ByCes8cfiQiImewUyMiImcE0amND2CfYRDV9x0mUfwMoviewyiKn0Mg79n339SIiIhyhcOPRETkDF87NREZJCLLRWSViIz2c99+EZESEZktIktEZLGI3BG/v0hEZorIyvi/7YJua1REoe4A1l4YRaH2wlZ3vg0/ikgMtVeauwjABgDzAQxT1SW+NMAnItIJQCdVXSgibQC8D+AyANcB2KaqY+PF3U5VRwXY1EiISt0BrL2wiUrtha3u/DxSOw3AKlVdrar7AbwAYLCP+/eFqpap6sJ43gVgKYDOqH2vk+ObTUbth065F4m6A1h7IRSJ2gtb3fnZqXUGsN5ze0P8PmeJSDcAfQDMA1CsqmXxhzYBKA6oWVETuboDWHshEbnaC0PdcaJIjohIawBTAdypqju9j2ntmC+nnVJOsPYoCGGpOz87tY0ASjy3j4zf5xwRKUDth/u8qr4Sv7s8PvZ8YAx6c1Dti5jI1B3A2guZyNRemOrOz05tPoCeItJdRJoBuBrAdB/37wsREQDPAFiqqg95HpoOYHg8Dwcwze+2RVQk6g5g7YVQJGovbHXn9yr93wDwMIAYgAmqer9vO/eJiJwN4G0AiwDUxO8eg9ox5pcAdEHtqt1DVHVbII2MmCjUHcDaC6Mo1F7Y6o4rihARkTM4UYSIiJzBTo2IiJzBTo2IiJzBTo2IiJzBTo2IiJzBTo2IiJzBTo2IiJzBTo2IiJzx/wGMtrg0RZN66QAAAABJRU5ErkJggg==\n",
            "text/plain": [
              "<Figure size 504x360 with 9 Axes>"
            ]
          },
          "metadata": {
            "tags": [],
            "needs_background": "light"
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "CSAu4Yx7AtG_",
        "outputId": "72d361d9-1c70-4254-e810-11c5a4cbaff1",
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 369
        }
      },
      "source": [
        "#Representation of few testing examples\n",
        "plt.figure(figsize=(7,5))\n",
        "for i in range(9):\n",
        "  plt.subplot(330+1+i)\n",
        "  plt.imshow(X_test[i])\n",
        "plt.tight_layout()"
      ],
      "execution_count": 394,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAbUAAAFgCAYAAAA8WedBAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3deWBU1d0+8OdLCEE2CYshhlUBWVREEFHailL3BWwrymst9sVSa6361iqUn62tW7Fv6+u+UKHghqJYwWoXpFK1IqsIkrBVQUBWAUGUQJLv74+M59yxM8kkmbvMuc/nH56ZuTP3jPN1Tu6Zc88VVQUREZELGoXdACIiomxhp0ZERM5gp0ZERM5gp0ZERM5gp0ZERM5gp0ZERM5oUKcmIueIyGoRWSci47PVKKLasPYoDKy76JP6nqcmInkA1gA4E8AmAIsAjFLV0uw1j+g/sfYoDKy73NC4Ac8dBGCdqn4AACLyLIDhANJ+wE2kQJuieQN2SakcwH4c1HIJux0BqlPtse78wbrjd15Yaqq9hnRqJQA2em5vAnByTU9oiuY4WYY1YJeUygKdG3YTglan2mPd+YN1x++8sNRUew3p1DIiImMBjAWApmjm9+6IALDuKDysvXA1ZKLIZgCdPLc7Ju5LoqqTVHWgqg7MR0EDdkdk1Fp7rDvyAb/zckBDOrVFAHqISDcRaQLgMgCzs9Msohqx9igMrLscUO/hR1WtEJFrAfwNQB6AKaq6MmstI0qDtUdhYN3lhgb9pqaqrwJ4NUttIcoYa4/CwLqLPq4oQkREzvB99iNRnK2/4xSTK5vahQ7a991h8vx+M9M+/+h/fN/klgsPM7no/rez1UQip/BIjYiInMFOjYiInMHhR6Is2/1KD5PfP+HBWrc/VMPyq6tOf9zkpwcWmzxjzmkmV5atrWMLiepGBvQ1+ZXZT5p83KPXmtzp9mgMifNIjYiInMFOjYiInMFOjYiInMHf1IiywPs72r9OeLbW7R/dc5TJ98w/0+SuXXYk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nRkREzmCnRkREzmCnRkREzhBVrX2rbO1MZAeA/QB21ratg9rBv/fdRVXb+/TaOS9Rdxvg72cQVay7ELH2gq+9QDs1ABCRxao6MNCdRkBc33eUxPEziON7jqI4fg5hvWcOPxIRkTPYqRERkTPC6NQmhbDPKIjr+46SOH4GcXzPURTHzyGU9xz4b2pERER+4fAjERE5I9BOTUTOEZHVIrJORMYHue+giEgnEXldREpFZKWIXJ+4v42IzBGRtYl/C8Nua1zEoe4A1l4UxaH2olZ3gQ0/ikgegDUAzgSwCcAiAKNUtTSQBgRERIoBFKvqUhFpCWAJgBEArgSwS1UnJoq7UFXHhdjUWIhL3QGsvaiJS+1Fre6CPFIbBGCdqn6gqgcBPAtgeID7D4SqblHVpYm8D0AZgBJUv9dpic2mofpDJ//Fou4A1l4ExaL2olZ3QXZqJQA2em5vStznLBHpCqA/gAUAilR1S+KhrQCKQmpW3MSu7gDWXkTErvaiUHecKOITEWkBYCaAG1R1r/cxrR7z5bRT8gVrj8IQlboLslPbDKCT53bHxH3OEZF8VH+4T6vqi4m7tyXGnr8cg94eVvtiJjZ1B7D2IiY2tReluguyU1sEoIeIdBORJgAuAzA7wP0HQkQEwGQAZap6j+eh2QBGJ/JoALOCbltMxaLuANZeBMWi9qJWd0Gv0n8egHsB5AGYoqp3BrbzgIjI1wC8CWAFgKrE3RNQPcY8A0BnVK/aPVJVd4XSyJiJQ90BrL0oikPtRa3uuKIIERE5gxNFiIjIGezUiIjIGezUiIjIGezUiIjIGezUiIjIGezUiIjIGezUiIjIGezUiIjIGf8fHwiur08W2CUAAAAASUVORK5CYII=\n",
            "text/plain": [
              "<Figure size 504x360 with 9 Axes>"
            ]
          },
          "metadata": {
            "tags": [],
            "needs_background": "light"
          }
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "PZF5-TurFt1u"
      },
      "source": [
        "#Flattening the given data\n",
        "num_pixels = X_train.shape[1] * X_train.shape[2]\n",
        "X_train = X_train.reshape((X_train.shape[0], num_pixels)).astype('float32')\n",
        "X_test = X_test.reshape((X_test.shape[0], num_pixels)).astype('float32')"
      ],
      "execution_count": 395,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "HMfFcFBZFu9T"
      },
      "source": [
        "#Converting the given data to a binary vector\n",
        "X_train = X_train/255\n",
        "X_test = X_test/255\n",
        "X_train = np.where(X_train!= 0, 1, 0)\n",
        "X_test = np.where(X_test!=0, 1, 0)"
      ],
      "execution_count": 396,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "qxgAHnqdONn_",
        "outputId": "68ba3a16-b26e-4793-963d-029d662e63be",
        "colab": {
          "base_uri": "https://localhost:8080/"
        }
      },
      "source": [
        "#Combining the given data to split further\n",
        "new_X= np.concatenate((X_train,X_test))\n",
        "new_y=np.concatenate((y_train,y_test))\n",
        "print('The shape of given X-data is',new_X.shape)\n",
        "print('The shape of given y-data is',new_y.shape)"
      ],
      "execution_count": 397,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "The shape of given X-data is (70000, 784)\n",
            "The shape of given y-data is (70000,)\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "HYepD6ebFtrK"
      },
      "source": [
        "#Function to split the data\n",
        "def split_data(data,ratio1,ratio2):\n",
        "  #Shuffling the data so as to randomnly choose the train and test set\n",
        "  set_size_1 = int(len(data)*ratio1)\n",
        "  set_size_2 = int(len(data)*(ratio2+ratio1))\n",
        "  #Dividing the given data into Test and Train datas\n",
        "  train_index = data[:set_size_1]\n",
        "  test_index = data[set_size_1:set_size_2]\n",
        "  validation_index = data[set_size_2:]\n",
        "  return train_index,test_index,validation_index"
      ],
      "execution_count": 398,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "ZKYQntKsi0MX"
      },
      "source": [
        "#Splitting the given data to 60-20-20 percentages of train,test,validation respectively\n",
        "X_train,X_test,X_validation = split_data(new_X,0.6,0.2)\n",
        "y_train,y_test,y_validation = split_data(new_y,0.6,0.2)"
      ],
      "execution_count": 399,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "cePq4wpO4-dA"
      },
      "source": [
        "#Re-shaping the y-data\n",
        "y_train=y_train.reshape(y_train.shape[0],1)\n",
        "y_test = y_test.reshape(y_test.shape[0],1)\n",
        "y_validation =y_validation.reshape(y_validation.shape[0],1)"
      ],
      "execution_count": 400,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "ASDU8iXZXTYc"
      },
      "source": [
        "# **`Task-2: Accuracy of the Decision tree on validation set`**"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "w-ZODgMCkehw"
      },
      "source": [
        "#Function to choose 'a'-random indexes\n",
        "def random_index(a):\n",
        "  n=[]\n",
        "  for i in range(a):\n",
        "    n.append(random.randint(0,X_train.shape[1]-1))\n",
        "  return n"
      ],
      "execution_count": 401,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "JNR1oWnykeY4"
      },
      "source": [
        "#Building X-train data\n",
        "X2 = random_index(10)\n",
        "X1=X_train[:,X2]"
      ],
      "execution_count": 402,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "l5yqG9LHkeGo",
        "outputId": "2f275683-ad4b-4229-d9da-f037f965086c",
        "colab": {
          "base_uri": "https://localhost:8080/"
        }
      },
      "source": [
        "#Building our Decision Tree model\n",
        "classifier = DecisionTreeClassifier(random_state = 0,max_depth=5)\n",
        "classifier.fit(X1, y_train) "
      ],
      "execution_count": 403,
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "DecisionTreeClassifier(ccp_alpha=0.0, class_weight=None, criterion='gini',\n",
              "                       max_depth=5, max_features=None, max_leaf_nodes=None,\n",
              "                       min_impurity_decrease=0.0, min_impurity_split=None,\n",
              "                       min_samples_leaf=1, min_samples_split=2,\n",
              "                       min_weight_fraction_leaf=0.0, presort='deprecated',\n",
              "                       random_state=0, splitter='best')"
            ]
          },
          "metadata": {
            "tags": []
          },
          "execution_count": 403
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "udG42uPvq_6o",
        "outputId": "40171326-c518-4025-db9f-4e30e5c936d5",
        "colab": {
          "base_uri": "https://localhost:8080/"
        }
      },
      "source": [
        "#Predicting and finding accuracy on validation set\n",
        "y_prediction = classifier.predict(X_validation[:,X2])\n",
        "accuracy = accuracy_score(y_validation, y_prediction)\n",
        "print('The accuracy of the model is:',accuracy*100)"
      ],
      "execution_count": 404,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "The accuracy of the model is: 40.32142857142857\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "jxHxwisHXnRW"
      },
      "source": [
        "# **`Task-3: Accuracy on validation set using 50 different models`**"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "ybuf14CDdcYY"
      },
      "source": [
        "#Function to build our model and predict its accuracy\n",
        "def decision_tree(X1,X2,y,X_valid,y_valid):\n",
        "  classifier = DecisionTreeClassifier(random_state = 0,max_depth=5)  \n",
        "  classifier.fit(X1, y) \n",
        "  y_pred = classifier.predict(X_valid[:,X2])\n",
        "  accuracy = accuracy_score(y_valid, y_pred)\n",
        "  #Returning the accuracy,predicted value and the model\n",
        "  return accuracy,y_pred,classifier"
      ],
      "execution_count": 405,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "KtZBJpSYcXla"
      },
      "source": [
        "#Variables to saved the predicted values,models,accuracies\n",
        "classifiers=[]\n",
        "accuracies = []\n",
        "pred=[]\n",
        "features=[]\n",
        "#Function to find the accuracies of 50-different classifiers\n",
        "for i in range(50):\n",
        "  X2 = random_index(10)\n",
        "  features.append(X2)\n",
        "  X1=X_train[:,X2]\n",
        "  accuracy,y_pred,classifier = decision_tree(X1,X2,y_train,X_validation,y_validation)\n",
        "  classifiers.append(classifier)\n",
        "  accuracies.append(accuracy)\n",
        "  pred.append(y_pred)"
      ],
      "execution_count": 406,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "M8PXKnegPIF6",
        "outputId": "95d1c09a-166b-47f1-bfde-53f05b9aa873",
        "colab": {
          "base_uri": "https://localhost:8080/"
        }
      },
      "source": [
        "#Printing the accuracies of the models\n",
        "for i in range(50):\n",
        "  print(\"Precentage Accuracy of model\",i+1,\":\",round(accuracies[i]*100,3))"
      ],
      "execution_count": 407,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Precentage Accuracy of model 1 : 21.5\n",
            "Precentage Accuracy of model 2 : 41.871\n",
            "Precentage Accuracy of model 3 : 39.779\n",
            "Precentage Accuracy of model 4 : 33.457\n",
            "Precentage Accuracy of model 5 : 24.464\n",
            "Precentage Accuracy of model 6 : 36.757\n",
            "Precentage Accuracy of model 7 : 25.9\n",
            "Precentage Accuracy of model 8 : 39.357\n",
            "Precentage Accuracy of model 9 : 22.893\n",
            "Precentage Accuracy of model 10 : 39.457\n",
            "Precentage Accuracy of model 11 : 29.993\n",
            "Precentage Accuracy of model 12 : 40.25\n",
            "Precentage Accuracy of model 13 : 31.971\n",
            "Precentage Accuracy of model 14 : 33.407\n",
            "Precentage Accuracy of model 15 : 47.143\n",
            "Precentage Accuracy of model 16 : 45.193\n",
            "Precentage Accuracy of model 17 : 46.693\n",
            "Precentage Accuracy of model 18 : 35.021\n",
            "Precentage Accuracy of model 19 : 26.986\n",
            "Precentage Accuracy of model 20 : 33.764\n",
            "Precentage Accuracy of model 21 : 32.379\n",
            "Precentage Accuracy of model 22 : 28.95\n",
            "Precentage Accuracy of model 23 : 32.271\n",
            "Precentage Accuracy of model 24 : 45.836\n",
            "Precentage Accuracy of model 25 : 28.436\n",
            "Precentage Accuracy of model 26 : 33.686\n",
            "Precentage Accuracy of model 27 : 24.85\n",
            "Precentage Accuracy of model 28 : 29.364\n",
            "Precentage Accuracy of model 29 : 29.593\n",
            "Precentage Accuracy of model 30 : 26.621\n",
            "Precentage Accuracy of model 31 : 40.014\n",
            "Precentage Accuracy of model 32 : 29.5\n",
            "Precentage Accuracy of model 33 : 40.921\n",
            "Precentage Accuracy of model 34 : 40.3\n",
            "Precentage Accuracy of model 35 : 43.371\n",
            "Precentage Accuracy of model 36 : 34.829\n",
            "Precentage Accuracy of model 37 : 30.643\n",
            "Precentage Accuracy of model 38 : 35.507\n",
            "Precentage Accuracy of model 39 : 37.014\n",
            "Precentage Accuracy of model 40 : 33.893\n",
            "Precentage Accuracy of model 41 : 37.321\n",
            "Precentage Accuracy of model 42 : 28.857\n",
            "Precentage Accuracy of model 43 : 42.7\n",
            "Precentage Accuracy of model 44 : 32.45\n",
            "Precentage Accuracy of model 45 : 37.293\n",
            "Precentage Accuracy of model 46 : 42.679\n",
            "Precentage Accuracy of model 47 : 43.1\n",
            "Precentage Accuracy of model 48 : 43.879\n",
            "Precentage Accuracy of model 49 : 21.536\n",
            "Precentage Accuracy of model 50 : 45.564\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "bS2xrmGTX024"
      },
      "source": [
        "# **`Task-4: Weighted classification of the test set`**"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "tES656vdPJUI"
      },
      "source": [
        "#Applying the above on the test data\n",
        "test_pred=[]\n",
        "for i in range(50):\n",
        "  X1=X_test[:,features[i]]\n",
        "  y_pred = classifiers[i].predict(X1)\n",
        "  test_pred.append(y_pred)\n",
        "y_prediction=np.array(test_pred)"
      ],
      "execution_count": 408,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "6YJjkMbfvhbS"
      },
      "source": [
        "#Predicting the accuracy on test data\n",
        "y_predicted_final=[]\n",
        "for i in range(y_prediction.shape[1]):\n",
        "  #Dictionary to check the weights \n",
        "  chance_dict={0:0,\n",
        "               1:0,\n",
        "               2:0,\n",
        "               3:0,\n",
        "               4:0,\n",
        "               5:0,\n",
        "               6:0,\n",
        "               7:0,\n",
        "               8:0,\n",
        "               9:0}\n",
        "  #Increasing the weights for the predicted values\n",
        "  for j in range(y_prediction.shape[0]):\n",
        "    chance_dict[y_prediction[j,i]]+=accuracies[j]\n",
        "  predict=max(chance_dict,key=chance_dict.get)\n",
        "  y_predicted_final.append(predict)"
      ],
      "execution_count": 409,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "FVCbeG0lQrSq",
        "outputId": "3677db25-a135-445e-c353-154c06ad8c74",
        "colab": {
          "base_uri": "https://localhost:8080/"
        }
      },
      "source": [
        "#Finding the accuracy\n",
        "w=0\n",
        "for i in range(14000):\n",
        "  if(y_test[i]==y_predicted_final[i]):\n",
        "    w+=1\n",
        "print(\"Percentage Accuracy:\",round(w/140,3))"
      ],
      "execution_count": 410,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Percentage Accuracy: 66.707\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "u_Ou3fX7YAmT"
      },
      "source": [
        "# **`Task-5: Implemeting Adaboost Algorithm`**"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "7-mcwJKPHm8Z"
      },
      "source": [
        "#Intialising the weights \n",
        "Weight=np.ones(shape=X_train.shape[0])/X_train.shape[0]"
      ],
      "execution_count": 411,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "Bh5r4jXYHmog"
      },
      "source": [
        "#Function to find out weighted error and weightage of our classifier\n",
        "def parameters(y_p,y_t,W): \n",
        "    eT = 0\n",
        "    #If correctly classified multiplying weight with zero else with one\n",
        "    for i in range(len(W)):\n",
        "        if(y_p[i]!=y_t[i]):\n",
        "            eT = eT + W[i]\n",
        "    #Calculating the weighted error\n",
        "    aT = 0.5*np.log((1-eT)/eT)\n",
        "    return aT,eT"
      ],
      "execution_count": 412,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "oY889Gxj12e_"
      },
      "source": [
        "#Function to updagte the weights\n",
        "def updating_weight(Weight,aT):\n",
        "    for i in range(len(Weight)):\n",
        "      #Checking if its correctly classified or not and accordingly increasing the weights\n",
        "            if(y_prediction[i]!=y_train[i]):\n",
        "                Weight[i] = Weight[i]*np.exp(aT)\n",
        "            else :\n",
        "                Weight[i] =  Weight[i]*np.exp(-aT)\n",
        "    return Weight"
      ],
      "execution_count": 413,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "WXqFZyeF15Ot"
      },
      "source": [
        "#Normalising the weights\n",
        "def normalising_weight(Weight):\n",
        "    m = sum(Weight)\n",
        "    Weight = Weight/m\n",
        "    return Weight"
      ],
      "execution_count": 414,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "fDz6KYwY0_g0"
      },
      "source": [
        "#Using the Random Forest as the initial Classifier for Adaboost\n",
        "for i in range(50):\n",
        "  y_prediction = classifiers[i].predict(X_train[:,features[i]])\n",
        "    #Finding the parameters\n",
        "  aT,eT = parameters(y_prediction,y_train,Weight)\n",
        "      #Accordingly updating the weights\n",
        "  Weight = updating_weight(Weight,aT)\n",
        "    #Finally normally the weights\n",
        "  Weight = normalising_weight(Weight)"
      ],
      "execution_count": 415,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "wWID-ixFVT0R"
      },
      "source": [
        "#Performing 20-iterations of Adaboost Algorithm\n",
        "classifier_a = []\n",
        "class_weight = []\n",
        "class_error = []\n",
        "for x in range(20):\n",
        "    #Making a new classifier\n",
        "    classifier = DecisionTreeClassifier(random_state = 0,max_depth=5,criterion=\"entropy\")\n",
        "    classifier_a.append(classifier)\n",
        "    classifier.fit(X_train, y_train,sample_weight = Weight) \n",
        "    #Predicting the X_train\n",
        "    y_prediction = classifier.predict(X_train)\n",
        "    #FInding the parameters\n",
        "    aT,eT = parameters(y_prediction,y_train,Weight)\n",
        "    class_weight.append(aT)\n",
        "    class_error.append(eT)\n",
        "    #Accordingly updating the weights\n",
        "    Weight = updating_weight(Weight,aT)\n",
        "    #Finally normally the weights\n",
        "    Weight = normalising_weight(Weight)"
      ],
      "execution_count": 416,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "tD-Iu80lUmUB",
        "outputId": "4f5ac0fb-4afb-483c-8b27-9fcbd3375d6a",
        "colab": {
          "base_uri": "https://localhost:8080/"
        }
      },
      "source": [
        "#Printing the weighted error\n",
        "for i in range(20):\n",
        "  print('The Weightage of classifier(aT):',i+1,':',class_weight[i])\n",
        "  print('The Weighted Error of classifier(eT)',i+1,':',class_error[i])\n",
        "  print()"
      ],
      "execution_count": 417,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "The Weightage of classifier(aT): 1 : 0.7892423950859849\n",
            "The Weighted Error of classifier(eT) 1 : 0.17101017973606716\n",
            "\n",
            "The Weightage of classifier(aT): 2 : 0.4861889152418881\n",
            "The Weighted Error of classifier(eT) 2 : 0.27440680394887856\n",
            "\n",
            "The Weightage of classifier(aT): 3 : 0.29224827222949756\n",
            "The Weighted Error of classifier(eT) 3 : 0.35789859646722516\n",
            "\n",
            "The Weightage of classifier(aT): 4 : 0.22543486474679975\n",
            "The Weighted Error of classifier(eT) 4 : 0.3891539999803237\n",
            "\n",
            "The Weightage of classifier(aT): 5 : 0.15984431141173366\n",
            "The Weighted Error of classifier(eT) 5 : 0.42075163472903604\n",
            "\n",
            "The Weightage of classifier(aT): 6 : 0.04824769772815282\n",
            "The Weighted Error of classifier(eT) 6 : 0.47589485254537417\n",
            "\n",
            "The Weightage of classifier(aT): 7 : 0.10159229961655125\n",
            "The Weighted Error of classifier(eT) 7 : 0.44937788734088857\n",
            "\n",
            "The Weightage of classifier(aT): 8 : 0.03181224985134842\n",
            "The Weighted Error of classifier(eT) 8 : 0.484099238671267\n",
            "\n",
            "The Weightage of classifier(aT): 9 : 0.026086714953801503\n",
            "The Weighted Error of classifier(eT) 9 : 0.48695960045878167\n",
            "\n",
            "The Weightage of classifier(aT): 10 : 0.03368253543256131\n",
            "The Weighted Error of classifier(eT) 10 : 0.48316509827495246\n",
            "\n",
            "The Weightage of classifier(aT): 11 : 0.023122421124158868\n",
            "The Weighted Error of classifier(eT) 11 : 0.48844084938376087\n",
            "\n",
            "The Weightage of classifier(aT): 12 : -0.0111274949624597\n",
            "The Weighted Error of classifier(eT) 12 : 0.5055635178560766\n",
            "\n",
            "The Weightage of classifier(aT): 13 : -6.883382752676018e-15\n",
            "The Weighted Error of classifier(eT) 13 : 0.5000000000000034\n",
            "\n",
            "The Weightage of classifier(aT): 14 : 1.1102230246251564e-16\n",
            "The Weighted Error of classifier(eT) 14 : 0.49999999999999994\n",
            "\n",
            "The Weightage of classifier(aT): 15 : -4.440892098500628e-16\n",
            "The Weighted Error of classifier(eT) 15 : 0.5000000000000002\n",
            "\n",
            "The Weightage of classifier(aT): 16 : 4.440892098500624e-16\n",
            "The Weighted Error of classifier(eT) 16 : 0.4999999999999998\n",
            "\n",
            "The Weightage of classifier(aT): 17 : -2.2204460492503136e-16\n",
            "The Weighted Error of classifier(eT) 17 : 0.5000000000000001\n",
            "\n",
            "The Weightage of classifier(aT): 18 : 1.1102230246251564e-16\n",
            "The Weighted Error of classifier(eT) 18 : 0.49999999999999994\n",
            "\n",
            "The Weightage of classifier(aT): 19 : 1.1102230246251564e-16\n",
            "The Weighted Error of classifier(eT) 19 : 0.49999999999999994\n",
            "\n",
            "The Weightage of classifier(aT): 20 : -2.2204460492503136e-16\n",
            "The Weighted Error of classifier(eT) 20 : 0.5000000000000001\n",
            "\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "V74jG0HcYL8A"
      },
      "source": [
        "# **`Task-6: Classification on the test set`**"
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "ZMiTwBMcVTiL"
      },
      "source": [
        "#Applying the above on the test data\n",
        "y_predA = []\n",
        "for i in range(20):\n",
        "    #Predicting the X-test data\n",
        "    predA = classifier_a[i].predict(X_test)\n",
        "    y_predA.append(predA)\n",
        "y_predA=np.array(y_predA)"
      ],
      "execution_count": 418,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "wuIskqvlVTOI"
      },
      "source": [
        "#Checking the number of correcly classified data\n",
        "correct_classified = 0\n",
        "y_predict_final=[]\n",
        "for i in range(len(X_test)):\n",
        "  prediction_dict={0:0,\n",
        "               1:0,\n",
        "               2:0,\n",
        "               3:0,\n",
        "               4:0,\n",
        "               5:0,\n",
        "               6:0,\n",
        "               7:0,\n",
        "               8:0,\n",
        "               9:0}\n",
        "  for j in range(20):\n",
        "    prediction_dict[y_predA[j,i]]+=class_weight[j]\n",
        "  predict = max(prediction_dict,key=prediction_dict.get)\n",
        "  y_predict_final.append(predict)"
      ],
      "execution_count": 419,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "bBjq2F1rbX7I",
        "outputId": "191dae47-54da-48ff-cb13-e468d291f495",
        "colab": {
          "base_uri": "https://localhost:8080/"
        }
      },
      "source": [
        "#Finding the accuracy\n",
        "acc=0\n",
        "for i in range(14000):\n",
        "  if(y_test[i]==y_predict_final[i]):\n",
        "    acc+=1\n",
        "print(\"Percentage Accuracy:\",round(acc/140,3))"
      ],
      "execution_count": 420,
      "outputs": [
        {
          "output_type": "stream",
          "text": [
            "Percentage Accuracy: 72.014\n"
          ],
          "name": "stdout"
        }
      ]
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "cFLAG4hffnH7"
      },
      "source": [
        ""
      ],
      "execution_count": 420,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "H1RU9f_lfnfC"
      },
      "source": [
        ""
      ],
      "execution_count": 420,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "ibM5fJK9fnS0"
      },
      "source": [
        ""
      ],
      "execution_count": 420,
      "outputs": []
    },
    {
      "cell_type": "code",
      "metadata": {
        "id": "C7FVwwR0fm9_"
      },
      "source": [
        ""
      ],
      "execution_count": 420,
      "outputs": []
    }
  ]
}